#include<bits/stdc++.h>
#define XH(i,a,b) for(int i=a;i<b;++i)
#define XXH(i,a,b) for(int i=a-1;i>=b;--i)
#define LL long long
using namespace std;
int tmpINT; string tmpSTRING; char tmpCHAR; double tmpDOUBLE; LL tmpLONGLONG;

int main(){
    cin>>tmpSTRING;
    int number = 0;
    number += (tmpSTRING[0]-'0')*1;    
    number += (tmpSTRING[2]-'0')*2;    
    number += (tmpSTRING[3]-'0')*3;    
    number += (tmpSTRING[4]-'0')*4;    
    number += (tmpSTRING[6]-'0')*5;    
    number += (tmpSTRING[7]-'0')*6;    
    number += (tmpSTRING[8]-'0')*7;    
    number += (tmpSTRING[9]-'0')*8;    
    number += (tmpSTRING[10]-'0')*9;    
    number %= 11;
    char c = number == 10?'X':'0'+number;
    if(c == tmpSTRING[12]){
        printf("Right\n");
    }else{
        cout<<tmpSTRING.substr(0,11);
        printf("-%c\n", c);
    }
    return 0;
}